﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AuthService;

public partial class Login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        AuthService.AuthService m_auth = new AuthService.AuthService();
        int RakazID = -1;
        RakazID=m_auth.AuthRakaz(txtEmail.Text, txtPassword.Text);
        if (RakazID == -1)
            Response.Redirect("Login.aspx");
        else
        {
            Session.Add("RakazID", RakazID);
            int rei = Convert.ToInt32(Request.QueryString["REID"]);
            Response.Redirect("Default.aspx?RakazEventID="+rei);
        }
    }
}